<?php
namespace bee;

/**
 *
 * @author dzelenika
 *
 */
trait Tsingleton
{

  /**
   * private construct, generally defined by using class   *
   * @return unknown
   */
  public static function __getInstance()
  {
		static $__instance = NULL;
		$class = __CLASS__;
		return $__instance ?: $__instance = new $class;
	}
  /**
   *
   * @throws exception
   */
	public function __clone()
	{
		throw new exception("Cloning ". __CLASS__. " is not allowed.", 6969);
	}

  /**
   * @abstract upitno treba li
   * @throws exception
   */
	public function __wakeup() {
		throw new exception("Unserializing " . __CLASS__ . " is not allowed", 6969);
	}

}
